﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WFWS.Core
{
    public class HttpCookie : IHttpCookie
    {
        private string _name = "";
        private string _value = "";
        private string _domain = "";
        private string _path = "";
        private bool _secure = false;
        private DateTime _expires;

        public HttpCookie() { }

        public HttpCookie(string name, string value):this(name,value,DateTime.MinValue,false) { }

        public HttpCookie(string name, string value, DateTime expires) : this(name, value, expires,false) { }

        public HttpCookie(string name, string value, DateTime expires, bool secure)
        {
            Name = name;
            Value = value;
            Expires = expires;
            Secure = secure;
        }

        #region ICookie Members

        public DateTime Expires
        {
            get
            {
                return _expires;
            }
            set
            {
                _expires = value;
            }
        }

        public string Name
        {
            get
            {
                return _name;
            }
            set
            {
                _name = value;
            }
        }

        public string Value
        {
            get
            {
                return _value;
            }
            set
            {
                _value = value;
            }
        }

        public string Domain
        {
            get
            {
                return _domain;
            }
            set
            {
                _domain = value;
            }
        }

        public string Path
        {
            get
            {
                return _path;
            }
            set
            {
                _path = value;
            }
        }

        public bool Secure
        {
            get
            {
                return _secure;
            }
            set
            {
                _secure = value;
            }
        }

        #endregion
    }
}
